package com.itlong.cloud.enumerate.ecode;

import lombok.Getter;
import lombok.Setter;

/**
 * <desc>
 *      物业app错误码枚举类
 * </desc>
 *
 * @createDate  2019/12/27
 */
public enum PropertyAppErrorCodeEnum {
    /*
     *mainCode为9表示物业App模块错误，subCode可用范围为1至999；
     */
    PUB_LOGIN_PARAMS_IS_EMPTY(9,1,"认证参数异常"),
    USER_REMIND_REPEAT_LOGIN(9,2,"您的账号在别的设备登录，如非本人操作，登录密码可能已泄露，请登录修改密码！"),
    USER_ACCOUNT_REFUSE(9,3,"账号已禁用，请联系物业"),
    PROPERTY_APP_SIGN_ERR(9,4,"参数签名错误"),
    PHONE_PASSWORD_EMPTY(9,5,"用户名或密码不能为空，请重新输入"),
    PHONE_NOT_MATCH(9,6,"手机号码格式错误，请重新输入"),
    PASSWORD_LENGTH_ERROR(9,7,"密码长度为6-16位"),
    USER_LOGIN_ERROR(9,8,"你输入的账户名或密码不正确"),
    USER_ACCOUNT_PROJECT_NOT_EXIST(9,9,"用户名错误或该账号下无项目"),
    USER_ACCOUNT_ERROR(9,10,"用户名输入错误,请重新输入"),
    INSPECT_POINT_EXIST_ERROR(9,11,"该巡检点编号暂未录入物业平台"),
    PROJECT_NOT_EXISTS(9,12,"该用户未拥有该项目"),
    ACCOUNT_NOT_BIND_PHONE(9,13,"该账号未绑定手机号码"),
    ACCOUNT_ROLE_NOT_EXIST(9,14,"该账号角色不存在"),
    ACCOUNT_ROLE_IS_FORBIDDEN_OR_AUTH_CLOSED(9,15,"该账号角色已被禁用或物业APP登录权限未开启"),
    PROJECT_IS_FORBIDDEN(9,16,"项目已被禁用"),
    PROJECT_ROLE_FORBIDDEN(9,17,"不支持该账号角色登录"),
    ALARM_POSITION_TOO_LONG(9,18,"输入的报警地点不能超过30个字符"),
    USER_HAVE_NO_INSPECT_PLAN(9,19,"该账号无需巡检"),
    ACCOUNT_HAVE_NO_INSPECT_PLAN(9,20,"暂无巡检计划"),
    ;


    @Setter
    @Getter
    private ErrorCode errorCode = new ErrorCode();

    PropertyAppErrorCodeEnum(){}

    /** 主错误码与错误信息构造函数
     *
     * @param mainCode
     */
    PropertyAppErrorCodeEnum(Integer mainCode, String codeMsg) {
        errorCode.setMainCode(mainCode);
        errorCode.setSubCode(0);
        errorCode.setCodeMsg(codeMsg);
    }

    /** 全参构造函数
     *
     * @param mainCode
     * @param subCode
     */
    PropertyAppErrorCodeEnum(Integer mainCode, Integer subCode, String codeMsg){
        errorCode.setMainCode(mainCode);
        errorCode.setSubCode(subCode);
        errorCode.setCodeMsg(codeMsg);
    }



}
